//
//  LCZTableHeadCell.m
//  PersonalNews
//
//  Created by Golibyo on 15/11/27.
//  Copyright © 2015年 changshuhua. All rights reserved.
//

#import "LCZTableHeadCell.h"

@implementation LCZTableHeadCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myImageView = [[LCZBaseImageView alloc] init];
        [self.contentView addSubview:self.myImageView];
//        self.myImageView.backgroundColor = [UIColor yellowColor];
        
        [self.myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
//           make.left.top.right.bottom.equalTo(self).insets(UIEdgeInsetsMake(10, 10, 10, 10));
            make.left.equalTo(self).with.offset(WIDTH / 375.0 * 10);
            make.top.equalTo(self).with.offset(HEIGHT / 667.0 * 10);
            
            make.height.width.mas_equalTo(HEIGHT / 667.0 * 80);
            
        }];
        self.myImageView.layer.cornerRadius = WIDTH / 375.0 * 40;
        self.myImageView.layer.masksToBounds = YES;
        
        
        self.titleLabel = [[LCZBaseLabel alloc] init];
        [self.contentView addSubview:self.titleLabel];
//        self.titleLabel.backgroundColor = [UIColor yellowColor];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).with.offset(HEIGHT / 667.0 * 10);
            make.left.equalTo(self.myImageView.mas_right).with.offset(WIDTH / 375.0 * 10);
            make.width.mas_equalTo(WIDTH / 375.0 * 150);
            make.height.mas_equalTo(HEIGHT / 667.0 * 30);
        }];

        self.detailLabel = [[LCZBaseLabel alloc] init];
//        self.detailLabel.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:self.detailLabel];
        self.detailLabel.font = [UIFont systemFontOfSize:WIDTH / 375.0 * 13];
        self.detailLabel.textColor = [UIColor grayColor];
        [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.titleLabel.mas_bottom).with.offset(HEIGHT / 667.0 * 5);
            make.left.equalTo(self.myImageView.mas_right).with.offset(WIDTH / 375.0 * 10);
            make.width.mas_equalTo(WIDTH / 375.0 * 250);
            make.height.mas_equalTo(HEIGHT / 667.0 * 20);
        }];
        
        self.timeLabel = [[LCZBaseLabel alloc] init];
//        self.timeLabel.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.timeLabel];
        self.timeLabel.font = [UIFont systemFontOfSize:WIDTH /375.0 * 12];
        self.timeLabel.textAlignment = NSTextAlignmentCenter;
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.detailLabel.mas_bottom).with.offset(HEIGHT / 667.0 * 5);
            make.bottom.equalTo(self).with.offset(-HEIGHT / 667.0 * 10);
            make.right.equalTo(self).with.offset(-WIDTH / 375.0 * 10);
            make.width.mas_equalTo(WIDTH / 375.0 * 50);
        }];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
